using AnimationPage.ViewModels;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;

namespace AnimationPage.Pages;

public partial class PageHost : UserControl
{
    public PageHost()
    {
        InitializeComponent();
    }

    public ApplicationPage CurrentPage
    {
        get => GetValue(CurrentPageProperty);
        set => SetValue(CurrentPageProperty, value);
    }

    public static readonly StyledProperty<ApplicationPage> CurrentPageProperty =
        AvaloniaProperty.Register<PageHost, ApplicationPage>(nameof(CurrentPage));

    public ViewModelBase CurrentPageViewModel
    {
        get => GetValue(CurrentPageViewModelProperty);
        set => SetValue(CurrentPageViewModelProperty, value);
    }

    public static readonly StyledProperty<ViewModelBase> CurrentPageViewModelProperty =
        AvaloniaProperty.Register<PageHost, ViewModelBase>(nameof(CurrentPageViewModel));

    protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
    {
        base.OnPropertyChanged(change);
        if (change.Property != CurrentPageProperty)
            return;
        
        
    }
}